package cn.zzuli.springcloud.controller;

import cn.zzuli.commons.entity.CommonResult;
import cn.zzuli.commons.entity.Payment;
import cn.zzuli.springcloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Date: 2020/12/6 17:43
 * @Author: 绯色下午茶
 * @Description:
 */
@RestController
@Slf4j
@RequestMapping("/consumer")
public class OrderFeignController {
    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping("/payment/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id) {
        return paymentFeignService.getPayMentById(id);
    }

    @GetMapping("/payment/timeout")
    public String paymentTimeout() {
        return paymentFeignService.paymentFeignTimeout();
    }

}
